---authing app
-- @module
local _svr = class('Authing', require('framework.cls.baseserver'))
-- ===================================
-- default params
local d = Ding
local Router = require("resty.router")
local rpc_authing = require("apps.rpc").authing
-- ===================================

function _svr:ctor(rt)
    dump(rt)
    ngx.log(ngx.INFO, "router authing:")
    _svr.super.ctor(self, rt)
    d.Logger:info('\n%s server is runing...', self:name())
end


-- =============
-- authing 回调
-- =============
-- {"/third/login_callback", "GET"}
function _svr:GET_login_callback() 
    rpc_authing.sc.login_callback()
end

-- =======================================
-- authing response_type code等  服务器模式
-- =======================================
-- {"/login", "GET"}
function _svr:GET_login() 
    rpc_authing.cs.login()
end

-- {"/signup", "GET"}
function _svr:GET_signup()
    dump("test")
end


-- ================
-- authing 三方登录
-- ================
-- {"/third/login/wx", "GET"}
function _svr:GET_third_login_wx()
    dump("third login wx")
    rpc_authing.cs.third_login_wx()
end

-- {"/third/login/github", "GET"}
function _svr:GET_third_login_github()
    dump("third login github")
    rpc_authing.cs.third_login_github()
end

return _svr
